<template>
  <error-tip :errorCode="errorCode" v-if="errorCode" >

</error-tip>
  <div v-else class="month">
  <month-picture :data="monthData"></month-picture>
 
  </div>
</template>

<script>
import { useStore } from 'vuex';
import { getNewdata } from '@/lib/unit';
import { onMounted,computed } from 'vue';
import getData from '@/service';
import MonthPicture from '@/components/MonthPicture/MonthPicture.vue';
export default {
  setup(){
 const store=useStore()
    onMounted(()=>{
      const field=store.state.field
      getData(field,getNewdata(field))
  
    })
    return {
    monthData:computed(()=>store.state.monthData),
    errorCode:computed(()=>store.state.errorCode)
  }
},
components:{
  MonthPicture,
}
}
</script>

<style lang="less" scoped>
    .month{
        padding: .82rem .44rem;
        box-sizing: border-box;
    }
</style>